<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<%@include file="../common/header.jsp"%>
<link rel="stylesheet" href="../resources/home/css/shop_manager.css" type="text/css" />
<link rel="stylesheet" href="../resources/home/css/shop_form.css" type="text/css" />
<style>
    .pagination{width:100%; margin:10px auto;}
    .pagination ul{float:right}
    .pagination ul li{float:left; margin:0 3px;}
    .pagination ul li span{display: inline-block; padding:5px 5px; border:1px solid #CCCCCC; color:#999999;}
    .pagination ul li span.currentpage{background-color:#FEA900; color:#FFF; font-weight: bold; border-color:#FEA900;}
    .header {
        width: 1230px;
        margin: 0 auto;
        height: 96px;
    }

    .header > #mallLogo {
        float: left;
        padding-top: 28px;
        width: 280px;
        height: 64px;
        line-height: 64px;
        position: relative;
    }

    #mallLogo > a {
        position: relative;
        display: block;
        width: 190px;
        height: 30px;
        overflow: hidden;
    }

    #mallLogo img {
        width: 190px;
        height: 28px;
        cursor: pointer;
        vertical-align: top;
    }

    .content {
        width: 950px;
        margin: 30px auto auto;
        min-height: 400px;
        padding-bottom: 60px;
        color: #666;
        position: relative;
    }

    .content > .order_div {
        position: relative;
    }

    .content > .order_div > img {
        position: absolute;
        left: 0;
        vertical-align: top;
    }

    .content > .order_div > .order_name, .content > .order_div > .order_shop_name {
        width: 600px;
        display: inline-block;
        color: #333;
        font-size: 12px;
        margin-left: 116px;
        line-height: 25px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .content > .order_div > .order_name {
        margin-top: 25px;
    }

    .content > .order_div > .order_price {
        position: absolute;
        right: 27px;
        top: 30px;
        float: right;
    }

    .order_price > .price_value {
        color: #ff8208;
        font-weight: 700;
        font-size: 22px;
    }

    .content > .order_pay_div {
        overflow: hidden;
        margin-top: 50px;
        text-align: center;
    }

    .order_pay_div .order_pay_btn {
        display: inline-block;
        width: 110px;
        height: 32px;
        color: #fff;
        border: 1px solid #0ae;
        background-color: #0ae;
        vertical-align: middle;
        cursor: pointer;
        font-size: 14px;
        font-weight: 700;
        border-radius: 2px;
        padding: 0 20px;
        margin: 0 auto;
        line-height: 32px;
    }

    .order_pay_btn:hover {
        background-color: #00A3D2;
        transition: background-color 0.5s;
        text-decoration: none;
    }
</style>
<body>
<div class="content">
    <div class="order_div">
        <img src="${path}/resources/home/images/payCode.png" width="100px"
             height="100px"/>
        <div class="order_price">
                <span class="price_value">${totalPrice}</span>
                <span class="price_unit">元</span>
        </div>
    </div>
    <div class="order_pay_div">
        <a class="order_pay_btn" href="javascript:void(0)" onclick="pay()">确认支付</a>
    </div>
</div>
<%@include file="../common/footer.jsp"%>
<script>
    function pay() {
        $.ajax({
            url: "${path}/order/pay2",
            type: "POST",
            success: function (data) {
                if(data.type == 'success'){
                	alert('下单成功!');
                	window.location.href = '../order/order_success?orderId='+data.oid;
                }else{
                	alert(data.msg);
                }
            },
            beforeSend: function () {

            },
            error: function () {
                alert("订单支付出现问题，请重新支付！");
                location.href = "/tmall/order/0/10";
            }
        });
    }
</script>
</body>